import request from '@/utils/request'
import { rsaEncrypt } from '@/utils/commonUtil3'

// 获取菜单列表信息
export function getMenuInfo(data) {
  return request({
    url: '/sysMenu/selectSysMenu',
    method: 'get',
    params: data
  })
}

// 添加菜单
export function addMenu(data) {
  const data1 = rsaEncrypt(data)
  return request({
    url: '/sysMenu/addSysMenu',
    method: 'post',
    data: {
      'data': data1
    }
  })
}

// 修改菜单信息
export function updateMenuDetail(data) {
  const data1 = rsaEncrypt(data)
  return request({
    url: '/sysMenu/updateSysMenu',
    method: 'put',
    data: {
      'data': data1
    }
  })
}

// 删除菜单信息
export function delMenu(data) {
  const data1 = rsaEncrypt(data)
  return request({
    url: '/sysMenu/deleteSysMenu',
    method: 'DELETE',
    data: {
      'data': data1
    }
  })
}

// 获取数据字典列表分页
export function getDicList(data) {
  return request({
    url: '/sysDictType/selectSysDictList',
    method: 'get',
    params: data
  }
  )
}

// 添加父级字典
export function addDicInfoParent(data) {
  const data1 = rsaEncrypt(data)
  return request({
    url: '/sysDictType/insert',
    method: 'post',
    data: {
      'data': data1
    }
  })
}

// 添加子级字典
export function addDicInfoChild(data) {
  const data1 = rsaEncrypt(data)
  return request({
    url: '/sysDict/insert',
    method: 'post',
    data: {
      'data': data1
    }
  })
}

// 删除父级字典
export function deleteDicInfoParent(data) {
  const data1 = rsaEncrypt(data)
  return request({
    url: '/sysDictType/delete',
    method: 'delete',
    data: {
      'data': data1
    }
  })
}

// 删除子级字典
export function deleteDicInfoChild(data) {
  const data1 = rsaEncrypt(data)
  return request({
    url: '/sysDict/delete',
    method: 'delete',
    data: {
      'data': data1
    }
  })
}

// 刷新字典
export function refreshDict(data) {
  return request({
    url: '/sysDict/loaderDictInfo',
    method: 'post',
    data: data
  })
}

// 添加收银菜单
export function addCashierMenu(data) {
  const data1 = rsaEncrypt(data)
  return request({
    url: '/store/menu/addStoreMenu',
    method: 'post',
    data: {
      'data': data1
    }
  })
}

// 查询收银菜单
export function selectCashierMenu(data) {
  return request({
    url: '/store/menu/select',
    method: 'get',
    params: data
  })
}

